
<%@ page import="com.trivia.Level" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <g:set var="entityName" value="${message(code: 'level.label', default: 'Level')}" />
        <title><g:message code="default.list.label" args="[entityName]" /></title>
        <nav:resources/>
    </head>
    <body>
        <div id="menu" class="nav">
		    <nav:render/>
        </div>
        <div class="nav">
            <span class="menuButton"><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></span>
        </div>
        <div class="body">
            <h1><g:message code="default.list.label" args="[entityName]" /></h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <div class="list">
                <table>
                    <thead>
                        <tr>
                        
                            <g:sortableColumn property="id" title="${message(code: 'level.id.label', default: 'Id')}" />
                        
                            <g:sortableColumn property="label" title="${message(code: 'level.label.label', default: 'Label')}" />
                        
                            <g:sortableColumn property="questionQuantity" title="${message(code: 'level.questionQuantity.label', default: 'Question Quantity')}" />
                        
                            <g:sortableColumn property="description" title="${message(code: 'level.description.label', default: 'Description')}" />
                        
                            <g:sortableColumn property="published" title="${message(code: 'level.published.label', default: 'Published')}" />
                        
                            <g:sortableColumn property="orderInFront" title="${message(code: 'level.orderInFront.label', default: 'Order In Front')}" />
                        
                        	<g:sortableColumn property="appTrivia" title="${message(code: 'scoring.appTrivia.label', default: 'App Trivia')}" />
                        </tr>
                    </thead>
                    <tbody>
                    <g:each in="${levelInstanceList}" status="i" var="levelInstance">
                        <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
                        
                            <td><g:link action="show" id="${levelInstance.id}">${fieldValue(bean: levelInstance, field: "id")}</g:link></td>
                        
                            <td>${fieldValue(bean: levelInstance, field: "label")}</td>
                        
                            <td>${fieldValue(bean: levelInstance, field: "questionQuantity")}</td>
                        
                            <td>${fieldValue(bean: levelInstance, field: "description")}</td>
                        
                            <td><g:formatBoolean boolean="${levelInstance.published}" /></td>
                        
                            <td>${fieldValue(bean: levelInstance, field: "orderInFront")}</td>
                            
                            <td>${fieldValue(bean: levelInstance, field: "appTrivia.appName")}</td>
                        
                        </tr>
                    </g:each>
                    </tbody>
                </table>
            </div>
            <div class="paginateButtons">
                <g:paginate total="${levelInstanceTotal}" />
            </div>
        </div>
    </body>
</html>
